package com.practice.Demo6_17;

import java.lang.reflect.Array;
import java.util.ArrayList;

public class order {

    public String name;
    public Double price;
    public int num;
    public void Show(){
        System.out.println(name+"--"+price+"--"+num);
    }

    public static Double PayTotal(order[] orders,int count){
        Double total=0.0;

        for (int i = 0; i < count; i++) {
            total+=orders[i].price*orders[i].num;
        }
        return total;
    }
    public static Double PayTotal(ArrayList<order> orders){
        Double total=0.0;

        for (order o : orders) {
            total+=o.price*o.num;
        }
        return total;
    }
}
